package ru.samgtu.wst.plugin.fuzz;

import java.util.regex.PatternSyntaxException;

import ru.samgtu.wst.util.RegexExpansion;

public class RegexSource extends RegexExpansion implements FuzzSource {

	private String description;

	/** Creates a new instance of RegexSource */
	public RegexSource(String description, String regex)
			throws PatternSyntaxException {
		super(regex);
		this.description = description;
	}

	protected RegexSource(RegexSource rs) {
		super(rs);
		this.description = rs.description;
	}

	public Object current() {
		return super.get(super.getIndex());
	}

	public String getDescription() {
		return this.description;
	}

	public void increment() {
		super.next();
	}

	public FuzzSource newInstance() {
		return new RegexSource(this);
	}

	public void reset() {
		super.setIndex(0);
	}

}
